/* Web 视觉检测系统样式 */

:root {
    --primary-color: #4CAF50;
    --secondary-color: #2196F3;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --dark-color: #333;
    --light-bg: #f5f5f5;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* 头部样式 */
header {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
}

header h1 {
    color: var(--dark-color);
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header p {
    color: #666;
    font-size: 1.1rem;
}

/* 功能卡片网格 */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

/* 功能卡片 */
.feature-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    color: var(--dark-color);
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.feature-card p {
    color: #666;
    font-size: 1rem;
    line-height: 1.6;
}

/* 检测页面样式 */
.detection-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.detection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.detection-header h2 {
    color: var(--dark-color);
    font-size: 2rem;
}

/* 视频显示区域 */
.video-container {
    position: relative;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.video-stream {
    width: 100%;
    height: auto;
    display: block;
}

.video-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.2rem;
}

/* 按钮样式 */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    font-weight: 500;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #45a049;
    transform: scale(1.05);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #0b7dda;
    transform: scale(1.05);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #da190b;
}

/* 控制面板 */
.controls {
    background: var(--light-bg);
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.control-group {
    margin-bottom: 15px;
}

.control-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--dark-color);
    font-weight: 500;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 5px;
    outline: none;
}

.control-group input[type="number"] {
    width: 80px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

/* 颜色预设 */
.color-presets {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.color-preset {
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid #ddd;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.color-preset:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

/* 信息提示 */
.info-box {
    background: #e3f2fd;
    border-left: 4px solid var(--secondary-color);
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.info-box p {
    margin: 5px 0;
    color: #1565c0;
}

/* 页脚 */
footer {
    text-align: center;
    color: white;
    padding: 20px;
    margin-top: 30px;
}

footer a {
    color: white;
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .detection-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn {
        width: 100%;
        text-align: center;
    }
}

/* 加载动画 */
.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 状态指示器 */
.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-online {
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}

.status-offline {
    background: var(--danger-color);
    box-shadow: 0 0 10px var(--danger-color);
}